package com.xblog.controller;

import com.jfinal.core.Controller;
import com.xblog.model.Blog;

import java.util.Date;

/**
 * Created by Administrator on 2015/7/22.
 */
public class BlogController extends Controller {
    public void index() {
        render("index.jsp");
    }

    public void form(){
        render("form.jsp");
    }

    public void blogadd(){
        Blog data = getModel(Blog.class,"blog");
        data.set("publishTime",new Date());
        data.save();
        index();
    }
}
